<include file="Public/popHeader"/>
<body class="hold-transition skin-blue sidebar-mini">
<!-- 内容页 -->
<div class="">
    <!-- 内容 -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <!-- /.box-header -->
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>订单ID</th>
                                <th>退款类型</th>
                            </tr>
                            <foreach name="lists" item="list">
                                    <td>{$list.order_id}</td>
                                    <td>{$list.typeMsg}</td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        {$page}
                    </div>
                    <!-- /.box-body -->
                </div>
            </div>
        </div>

    </section>
</div>
</body>
<script>
    $(function () {
        var chids = parent.$("#yc-goods-ids").val();
        var ychser = new YcChoser();
        ychser.setChosenIds(chids);

        $(".grid-item").each(function(){
            if(ychser.isRepeat($(this).attr("data-id"))){
                $(this).prop("checked", "checked");
            }
        });

        $('.grid-select-all').change(function () {
            if (this.checked) {
                $('.grid-item').prop("checked", true);
            } else {
                $('.grid-item').prop("checked", false);
            }
        });

        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

        $('.add-goods').on('click', function () {
            $('.grid-item').each(function () {
                var id = $(this).data('id'); // id
                var name = $(this).data('name'); // 商品名称
                var info = $(this).data('info'); // 商品规格
                var price = $(this).data('price'); // 商品售价

                var flag = ychser.isRepeat($(this).attr("data-id"));
                if(flag && !$(this).is(':checked')){
                    ychser.remove();
                    parent.$('.ui-sortable').children("li").eq(ychser.getPosition()).remove();
                }else if ($(this).is(':checked') && !flag) {
                    ychser.add($(this).attr("data-id"));
                    var html = '';
                    html += '<li>';
                    html += '<input type="hidden" name="goods_id[]" value="'+id+'">';
                    html += '<a href="javascript:;" title="'+(name + info)+'" class="text ebatch-name"> '+name+ info+'</a>';
                    html += '<h style="margin-right: 50px">售价: '+price+'元 </h>';
                    html += '<h class="result_price_one"  style="color:red; display: none;float: right" >促销价:<input type="text"  style="width: 60px ;color: black" prices="'+price+'" class="is_price" name="promotion_price[]" value="">元</h>';
                    html += '<input type="hidden"  name="current_price[]" value="'+price+'"/>';
                    html += '<div class="tools">';
                    html += '<i class="fa fa-trash-o icondel" data-id="'+id+'" onclick="delGoodsItem(this)"></i>';
                    html += '</div>';
                    html += '</li>';
                    parent.$('.ui-sortable').append(html);
                }
            });
            parent.updateGoodsIds(ychser.getChosenIds());
            parent.layer.close(index);
        });
    });

    showBigPicture();
</script>

